package proxy.cglib;

public class Client {
    public static void main(String[] args) {
        // 目标对象
        TeacherDao teacherDao = new TeacherDao();
        // 获取到代理对象 并且将目标对象传递给代理对象
        TeacherDao factory = (TeacherDao) new ProxyFactory(teacherDao).getProxyInstance();
        // 执行代理对象的方法 触发intecept方法 从而实现对目标对象的调用
        String teach = factory.teach();
        System.out.println(teach);
    }
}
